package com.zr.spring.jdbc;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class SpringJdbcTest {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("classpath:META-INF\\jdbc\\person-jdbc.xml");
        PersonService service = (PersonService) context.getBean("personService");

        Person person = new Person(1, "zhanrui", 12);
        service.save(person);

        List<Person> list = service.getPerson();
        list.forEach(v -> {
            System.out.println(v.toString());
        });
    }

}
